import React from 'react';
import { useState } from 'react';
import { NavLink } from 'react-router-dom';

// 导入路由配置信息
import router from '../../router';

function Nav(props) {

    let [nav, setNav] = useState(router);




    return (
        <div className='nav'>
            {
                nav.map((item, index) => {
                    return (
                        item.meta.isShow ? <NavLink key={index} to={item.path}>{item.meta.title}</NavLink > : null
                    )
                })
            }

        </div>
    );
}

export default Nav;